package com.zpdhy.summer.guice.module;

import com.google.inject.AbstractModule;
import com.zpdhy.summer.guice.annotation.Output;
import com.zpdhy.summer.guice.service.MyApplet;
import com.zpdhy.summer.guice.service.MyDestination;
import com.zpdhy.summer.guice.service.impl.PrintStreamWriter;
import com.zpdhy.summer.guice.service.impl.StringWritingApplet;

import java.io.PrintStream;

/**
 * Created by Administrator on 2017/11/21.
 */
public class HelloWroldModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(MyApplet.class).to(StringWritingApplet.class);
        bind(MyDestination.class).to(PrintStreamWriter.class);
        bind(PrintStream.class).toInstance(System.out);
        bind(String.class).annotatedWith(Output.class).toInstance("Hello World!");
    }
}
